package weaver.formmode.customjavacode.modeexpand.crm;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.interfaces.cese.duss.ceseutil.CostUtil;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

/**
 * @Title: ecology-9-demo
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2020-10-23
 * @Description: 浪潮影像上传
 * @ModifyLog:
 **/
public class WeaImageUploadAction extends BaseBean implements Action {
    @Override
    public String execute(RequestInfo requestInfo) {
        RecordSet rs = new RecordSet();
        String requestid = requestInfo.getRequestid();
        String tablename = requestInfo.getRequestManager().getBillTableName();//主表
        String workflowid = requestInfo.getWorkflowid();//获取节点类型
        String currentDate = requestInfo.getRequestManager().getCurrentDate();//当前日期
        String currentNodeType = CostUtil.getCurrentNodeType( workflowid, requestid );//当前节点
        writeLog( "----WeaImageUploadAction-------" + requestid );
        try {
            rs.executeQuery( "select id,yshd,cblrzx,sqrq,ywsqd from " + tablename + " where requestid=?", requestid );
            rs.next();
            String mainid = Util.null2String( rs.getString( "id" ) );//mainid
            String ywsqd = Util.null2String( rs.getString( "ywsqd" ) );//业务申请单
            String yshd = Util.null2String( rs.getString( "yshd" ) );//预算活动
            String cblrzx = Util.null2String( rs.getString( "cblrzx" ) );//成本/利润中心
            String fysjfsrq = Util.null2String( rs.getString( "fysjfsrq" ) );//费用实际发生日期
            return Action.SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            writeLog( "异常参考:" + e );
            requestInfo.getRequestManager().setMessageid( "111111" );
            requestInfo.getRequestManager().setMessagecontent( "Action接口异常！" );
            return Action.FAILURE_AND_CONTINUE;
        }
    }
}
